package service.impl;

import dao.StudentDao;
import dao.impl.StudentDaoImpl;
import model.Student;
import service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    StudentDao studentDao = new StudentDaoImpl();

    @Override
    public int addStudent(Student student) {
        return studentDao.addStudent(student);
    }

    @Override
    public List<Student> getAll(String stuname, String stuno, int stusex, int pageIndex, int pageSize) {
        return studentDao.getAll(stuname, stuno, stusex, pageIndex, pageSize);
    }

    @Override
    public int total(String stuname, String stuno, int stusex) {
        return studentDao.total(stuname, stuno, stusex);
    }

    @Override
    public Student findById(int sid) {
        return studentDao.findById(sid);
    }

    @Override
    public int updateStudent(Student student) {
        return studentDao.updateStudent(student);
    }

    @Override
    public int deleteById(int id) {
        return studentDao.deleteById(id);
    }

    @Override
    public int deleteStats(int sid) {
        return studentDao.deleteStats(sid);
    }
}
